package com.yonyou.cyxdms.basedata.service.entity.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.time.LocalDateTime;

/**
 * <p>
 * 车型
 * </p>
 *
 * @author renwd
 * @since 2018-12-11
 */
@TableName("tm_model")
public class ModelPO extends DMSBasePO<ModelPO> {

    private static final long serialVersionUID = 1L;

    /**
     * MODELID
     */
    @TableId(value = "MODEL_ID", type = IdType.AUTO)
    private Long modelId;

    /**
     * APP_ID
     */
    @TableField("APP_ID")
    private String appId;

    /**
     * 品牌ID(售后冗余)
     */
    @TableField("BRAND_ID")
    private Long brandId;

    /**
     * SERIESID
     */
    @TableField("SERIES_ID")
    private Long seriesId;

    /**
     * 公司代码
     */
    @TableField("COMPANY_CODE")
    private String companyCode;
    /**
     * 所有者代码
     */
    @TableField("OWNER_CODE")
    private String ownerCode;

    /**
     * 所有者的父组织代码（用于二网使用）
     */
    @TableField("OWNER_PAR_CODE")
    private String ownerParCode;

    /**
     * 车型代码
     */
    @TableField("MODEL_CODE")
    private String modelCode;
    /**
     * 车型名称
     */
    @TableField("MODEL_NAME")
    private String modelName;

    /**
     * 上游数据来源ID
     */
    @TableField("SOURCE_ID")
    private String sourceId;

    @TableField("SOURCE_CHANGED_AT")
    private LocalDateTime sourceChangedAt;

    /**
     * 资料来源
     */
    @TableField("DATA_SOURCES")
    private Integer dataSources;
    /**
     * 是否有效
     */
    @TableField("IS_VALID")
    private Integer isValid;

    @TableField("START_DATE")
    private LocalDateTime startDate;

    @TableField("CREATED_BY")
    private String createdBy;

    @TableField("CREATED_AT")
    private LocalDateTime createdAt;

    @TableField("COMMON_PLATFORM_FLAG")
    private Integer commonPlatformFlag;

    @TableField("UPDATED_AT")
    private LocalDateTime updatedAt;

    @TableField("IS_ISSUE")
    private Integer isIssue;

    @TableField("SEND_DATE")
    private LocalDateTime sendDate;

    @TableField("SEND_BY")
    private String sendBy;


    public Long getModelId() {
        return modelId;
    }

    public void setModelId(Long modelId) {
        this.modelId = modelId;
    }

    public Long getBrandId() {
        return brandId;
    }

    public void setBrandId(Long brandId) {
        this.brandId = brandId;
    }

    public Long getSeriesId() {
        return seriesId;
    }

    public void setSeriesId(Long seriesId) {
        this.seriesId = seriesId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public String getOwnerParCode() {
        return ownerParCode;
    }

    public void setOwnerParCode(String ownerParCode) {
        this.ownerParCode = ownerParCode;
    }

    public String getModelCode() {
        return modelCode;
    }

    public void setModelCode(String modelCode) {
        this.modelCode = modelCode;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public String getSourceId() {
        return sourceId;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }

    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }

    public Integer getDataSources() {
        return dataSources;
    }

    public void setDataSources(Integer dataSources) {
        this.dataSources = dataSources;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public static long getSerialVersionUid() {
        return serialVersionUID;
    }

    public LocalDateTime getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDateTime startDate) {
        this.startDate = startDate;
    }

    @Override
    public String getCreatedBy() {
        return createdBy;
    }

    @Override
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Override
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    @Override
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public Integer getCommonPlatformFlag() {
        return commonPlatformFlag;
    }

    public void setCommonPlatformFlag(Integer commonPlatformFlag) {
        this.commonPlatformFlag = commonPlatformFlag;
    }


    @Override
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    @Override
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }


    public Integer getIsIssue() {
        return isIssue;
    }

    public void setIsIssue(Integer isIssue) {
        this.isIssue = isIssue;
    }

    public LocalDateTime getSendDate() {
        return sendDate;
    }

    public void setSendDate(LocalDateTime sendDate) {
        this.sendDate = sendDate;
    }

    public String getSendBy() {
        return sendBy;
    }

    public void setSendBy(String sendBy) {
        this.sendBy = sendBy;
    }

    @Override
    public String toString() {
        return "ModelPO{" +
                "modelId=" + modelId +
                ", appId='" + appId + '\'' +
                ", brandId=" + brandId +
                ", seriesId=" + seriesId +
                ", companyCode='" + companyCode + '\'' +
                ", ownerCode='" + ownerCode + '\'' +
                ", ownerParCode='" + ownerParCode + '\'' +
                ", modelCode='" + modelCode + '\'' +
                ", modelName='" + modelName + '\'' +
                ", sourceId=" + sourceId +
                ", sourceChangedAt=" + sourceChangedAt +
                ", dataSources=" + dataSources +
                ", isValid=" + isValid +
                ", startDate='" + startDate +
                ", createdAt=" + createdAt +
                ", createdBy=" + createdBy +
                ", commonPlatformFlag=" + commonPlatformFlag +
                ", updatedAt=" + updatedAt +
                '}';
    }

    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author renwd
     * @since 2018/7/22 0022
     */
    protected <T extends DMSBaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "modelId");
    }


}
